# frozen_string_literal: true

module Types
  module MergeRequests
    class ReviewLlmSummaryType < ::Types::BaseObject
      graphql_name 'MergeRequestReviewLlmSummary'
      description 'A review summary generated by AI.'

      authorize :read_merge_request

      field :merge_request_diff_id,
        GraphQL::Types::ID,
        null: false,
        description: 'ID of the Merge Request diff associated with the review summary.'

      field :user, Types::UserType,
        null: true,
        description: 'User associated with the review summary.'

      field :reviewer, Types::UserType,
        null: true,
        description: 'User who authored the review associated with the review summary.'

      field :provider, GraphQL::Types::String,
        null: false,
        description: 'AI provider that generated the summary.'

      field :content, GraphQL::Types::String,
        null: false,
        description: 'Content of the review summary.'

      field :created_at, Types::TimeType,
        null: false,
        description: 'Timestamp of when the review summary was created.'

      field :updated_at, Types::TimeType,
        null: false,
        description: 'Timestamp of when the review summary was updated.'
    end
  end
end
